package com.itheima.day13.Zuoye.ZuoYe2;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Jiang {
    public static void main(String[] args) throws Exception {
        List<Integer> j =  new ArrayList<>();
        int[] x = {10,5,20,50,100,200,500,800,2,80,300,700};
        for (int i = 0; i < x.length; i++) {
                j.add(x[i]);
        }
        Mythread t1 = new Mythread("t1",j);
        Mythread t2 = new Mythread("t2",j);
        t1.start();
        t2.start();
        t1.join();
        t2.join();

        // 显示统计结果
        System.out.println("t1抽中的奖品: " + t1.getT1count());
        System.out.println("t2抽中的奖品: " + t2.getT2count());
        System.out.println("t1抽中奖品总金额: " +
                t1.getT1count().stream().mapToInt(Integer::intValue).sum());
        System.out.println("t2抽中奖品总金额: " +
                t2.getT2count().stream().mapToInt(Integer::intValue).sum());
    }
}
